<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkMenuItem</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="MenusAndCombos.html" title="菜单、组合框和工具栏">
<link rel="prev" href="gtk3-GtkMenuBar.html" title="GtkMenuBar">
<link rel="next" href="gtk3-GtkImageMenuItem.html" title="GtkImageMenuItem">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkMenuBar.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="MenusAndCombos.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkImageMenuItem.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkMenuItem.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkMenuItem.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkMenuItem"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkMenuItem.top_of_page"></a>GtkMenuItem</span></h2>
<p>GtkMenuItem</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkMenuItem.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem">GtkMenuItem</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-new" title="gtk_menu_item_new ()">gtk_menu_item_new</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-new-with-label" title="gtk_menu_item_new_with_label ()">gtk_menu_item_new_with_label</a>        (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-new-with-mnemonic" title="gtk_menu_item_new_with_mnemonic ()">gtk_menu_item_new_with_mnemonic</a>     (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-right-justified" title="gtk_menu_item_set_right_justified ()">gtk_menu_item_set_right_justified</a>   (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> right_justified</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-get-right-justified" title="gtk_menu_item_get_right_justified ()">gtk_menu_item_get_right_justified</a>   (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-get-label" title="gtk_menu_item_get_label ()">gtk_menu_item_get_label</a>             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-label" title="gtk_menu_item_set_label ()">gtk_menu_item_set_label</a>             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-get-use-underline" title="gtk_menu_item_get_use_underline ()">gtk_menu_item_get_use_underline</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-use-underline" title="gtk_menu_item_set_use_underline ()">gtk_menu_item_set_use_underline</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> setting</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-submenu" title="gtk_menu_item_set_submenu ()">gtk_menu_item_set_submenu</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *submenu</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-get-submenu" title="gtk_menu_item_get_submenu ()">gtk_menu_item_get_submenu</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-accel-path" title="gtk_menu_item_set_accel_path ()">gtk_menu_item_set_accel_path</a>        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-get-accel-path" title="gtk_menu_item_get_accel_path ()">gtk_menu_item_get_accel_path</a>        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-select" title="gtk_menu_item_select ()">gtk_menu_item_select</a>                (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-deselect" title="gtk_menu_item_deselect ()">gtk_menu_item_deselect</a>              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-activate" title="gtk_menu_item_activate ()">gtk_menu_item_activate</a>              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-toggle-size-request" title="gtk_menu_item_toggle_size_request ()">gtk_menu_item_toggle_size_request</a>   (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *requisition</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-toggle-size-allocate" title="gtk_menu_item_toggle_size_allocate ()">gtk_menu_item_toggle_size_allocate</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> allocation</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-get-reserve-indicator" title="gtk_menu_item_get_reserve_indicator ()">gtk_menu_item_get_reserve_indicator</a> (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-reserve-indicator" title="gtk_menu_item_set_reserve_indicator ()">gtk_menu_item_set_reserve_indicator</a> (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> reserve</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenuItem.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkMenuItem.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkMenuItem"></a><h3>struct GtkMenuItem</h3>
<pre class="programlisting">struct GtkMenuItem {
  GtkBin bin;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-new"></a><h3>gtk_menu_item_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_item_new                   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-new-with-label"></a><h3>gtk_menu_item_new_with_label ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_item_new_with_label        (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-new-with-mnemonic"></a><h3>gtk_menu_item_new_with_mnemonic ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_item_new_with_mnemonic     (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> containing a label.
</p>
<p>
The label will be created using <a class="link" href="gtk3-GtkLabel.html#gtk-label-new-with-mnemonic" title="gtk_label_new_with_mnemonic ()"><code class="function">gtk_label_new_with_mnemonic()</code></a>,
so underscores in <em class="parameter"><code>label</code></em> indicate the mnemonic for the menu item.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>The text of the button, with an underscore in front of the
mnemonic character</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-set-right-justified"></a><h3>gtk_menu_item_set_right_justified ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_set_right_justified   (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> right_justified</code></em>);</pre>
<p>
Sets whether the menu item appears justified at the right
side of a menu bar. This was traditionally done for "Help"
menu items, but is now considered a bad idea. (If the widget
layout is reversed for a right-to-left language like Hebrew
or Arabic, right-justified-menu-items appear at the left.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>right_justified</code></em> :</span></p></td>
<td>if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> the menu item will appear at the
far right if added to a menu bar</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-get-right-justified"></a><h3>gtk_menu_item_get_right_justified ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_menu_item_get_right_justified   (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
Gets whether the menu item appears justified at the right
side of the menu bar.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the menu item will appear at the
far right if added to a menu bar.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-get-label"></a><h3>gtk_menu_item_get_label ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_menu_item_get_label             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
Sets <em class="parameter"><code>text</code></em> on the <em class="parameter"><code>menu_item</code></em> label
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The text in the <em class="parameter"><code>menu_item</code></em> label. This is the internal
string used by the label, and must not be modified.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-set-label"></a><h3>gtk_menu_item_set_label ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_set_label             (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Sets <em class="parameter"><code>text</code></em> on the <em class="parameter"><code>menu_item</code></em> label
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text you want to set</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-get-use-underline"></a><h3>gtk_menu_item_get_use_underline ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_menu_item_get_use_underline     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
Checks if an underline in the text indicates the next character
should be used for the mnemonic accelerator key.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if an embedded underline in the label
indicates the mnemonic accelerator key.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-set-use-underline"></a><h3>gtk_menu_item_set_use_underline ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_set_use_underline     (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> setting</code></em>);</pre>
<p>
If true, an underline in the text indicates the next character
should be used for the mnemonic accelerator key.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>setting</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if underlines in the text indicate mnemonics</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.16</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-set-submenu"></a><h3>gtk_menu_item_set_submenu ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_set_submenu           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="type">GtkWidget</span></a> *submenu</code></em>);</pre>
<p>
Sets or replaces the menu item's submenu, or removes it when a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
submenu is passed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>submenu</code></em> :</span></p></td>
<td>the submenu, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-get-submenu"></a><h3>gtk_menu_item_get_submenu ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_menu_item_get_submenu           (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
Gets the submenu underneath this menu item, if any.
See <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-submenu" title="gtk_menu_item_set_submenu ()"><code class="function">gtk_menu_item_set_submenu()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>submenu for this menu item, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-set-accel-path"></a><h3>gtk_menu_item_set_accel_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_set_accel_path        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *accel_path</code></em>);</pre>
<p>
Set the accelerator path on <em class="parameter"><code>menu_item</code></em>, through which runtime
changes of the menu item's accelerator caused by the user can be
identified and saved to persistent storage (see <a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-save" title="gtk_accel_map_save ()"><code class="function">gtk_accel_map_save()</code></a>
on this). To set up a default accelerator for this menu item, call
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-entry" title="gtk_accel_map_add_entry ()"><code class="function">gtk_accel_map_add_entry()</code></a> with the same <em class="parameter"><code>accel_path</code></em>. See also
<a class="link" href="gtk3-Accelerator-Maps.html#gtk-accel-map-add-entry" title="gtk_accel_map_add_entry ()"><code class="function">gtk_accel_map_add_entry()</code></a> on the specifics of accelerator paths,
and <a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-accel-path" title="gtk_menu_set_accel_path ()"><code class="function">gtk_menu_set_accel_path()</code></a> for a more convenient variant of
this function.
</p>
<p>
This function is basically a convenience wrapper that handles
calling <a class="link" href="gtk3-GtkWidget.html#gtk-widget-set-accel-path" title="gtk_widget_set_accel_path ()"><code class="function">gtk_widget_set_accel_path()</code></a> with the appropriate accelerator
group for the menu item.
</p>
<p>
Note that you do need to set an accelerator on the parent menu with
<a class="link" href="gtk3-GtkMenu.html#gtk-menu-set-accel-group" title="gtk_menu_set_accel_group ()"><code class="function">gtk_menu_set_accel_group()</code></a> for this to work.
</p>
<p>
Note that <em class="parameter"><code>accel_path</code></em> string will be stored in a <a href="../glib/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>.
Therefore, if you pass a static string, you can save some memory
by interning it first with <a href="../glib/glib-Quarks.html#g-intern-static-string"><code class="function">g_intern_static_string()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a valid <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_path</code></em> :</span></p></td>
<td>accelerator path, corresponding to this menu
item's functionality, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to unset the current path. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-get-accel-path"></a><h3>gtk_menu_item_get_accel_path ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_menu_item_get_accel_path        (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
Retrieve the accelerator path that was previously set on <em class="parameter"><code>menu_item</code></em>.
</p>
<p>
See <a class="link" href="gtk3-GtkMenuItem.html#gtk-menu-item-set-accel-path" title="gtk_menu_item_set_accel_path ()"><code class="function">gtk_menu_item_set_accel_path()</code></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a valid <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the accelerator path corresponding to this menu
item's functionality, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if not set</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-select"></a><h3>gtk_menu_item_select ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_select                (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-deselect"></a><h3>gtk_menu_item_deselect ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_deselect              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-activate"></a><h3>gtk_menu_item_activate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_activate              (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-toggle-size-request"></a><h3>gtk_menu_item_toggle_size_request ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_toggle_size_request   (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *requisition</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-toggle-size-allocate"></a><h3>gtk_menu_item_toggle_size_allocate ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_toggle_size_allocate  (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> allocation</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-get-reserve-indicator"></a><h3>gtk_menu_item_get_reserve_indicator ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_menu_item_get_reserve_indicator (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>);</pre>
<p>
Returns whether the <em class="parameter"><code>menu_item</code></em> reserves space for
the submenu indicator, regardless if it has a submenu
or not.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>menu_item</code></em> always reserves space for the
submenu indicator</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-menu-item-set-reserve-indicator"></a><h3>gtk_menu_item_set_reserve_indicator ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_menu_item_set_reserve_indicator (<em class="parameter"><code><a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a> *menu_item</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> reserve</code></em>);</pre>
<p>
Sets whether the <em class="parameter"><code>menu_item</code></em> should reserve space for
the submenu indicator, regardless if it actually has
a submenu or not.
</p>
<p>
There should be little need for applications to call
this functions.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>menu_item</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkMenuItem.html#GtkMenuItem" title="struct GtkMenuItem"><span class="type">GtkMenuItem</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>reserve</code></em> :</span></p></td>
<td>the new value</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>